package com.ojoin.trade.supplyloan_core.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.common.web.service.impl.BaseServiceImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlFinanceinfoDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlFinanceinfo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlFinanceinfoVO;
import com.ojoin.trade.supplyloan_core.web.service.TbSlFinanceinfoService;

@Service
public class TbSlFinanceinfoServiceImpl extends
		BaseServiceImpl<TbSlFinanceinfo> implements
		TbSlFinanceinfoService {
	@Autowired
	private TbSlFinanceinfoDao dao;

	@Override
	protected BaseDao<TbSlFinanceinfo> getBaseDao() {
		return dao; 
	}

	@Override
	public List<TbSlFinanceinfoVO> queryAllUserUnsuccessRefundTask()
			throws BusinessException {
		return ((TbSlFinanceinfoDao) this.getBaseDao()).queryAllUserUnsuccessRefundTask();
	}

	@Override
	public TbSlFinanceinfoVO queryUserLastRefundTaskById(int joinuserid)
			throws BusinessException {
		return ((TbSlFinanceinfoDao) this.getBaseDao()).queryUserLastRefundTaskById(joinuserid);
	}

	@Override
	public int insertSLFinanceInfo(TbSlFinanceinfo vo) throws BusinessException {
		return ((TbSlFinanceinfoDao) this.getBaseDao()).insert(vo);
	}
	
	public int updateSLFinalceStatusAndMemoById(int id, int status, String memo) throws BusinessException {
		return ((TbSlFinanceinfoDao) this.getBaseDao()).updateSLFinalceStatusAndMemoById(id, status, memo);
	}
}
